package com.BlogPark.service.NoticeService.Impl;

import com.BlogPark.mapper.NoticeMapper;
import com.BlogPark.pojo.Notice;
import com.BlogPark.service.NoticeService.NoticeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class NoticeServiceImpl implements NoticeService {
    @Autowired
    private NoticeMapper noticeMapper;

    @Override
    public int addNotice(Notice notice) {
        int row = noticeMapper.addNotice(notice);
        return row;
    }

    @Override
    public List<Notice> selectAll() {
        List<Notice> notices = noticeMapper.selectAll();
        return notices;
    }

    @Override
    public int deleteById(Integer id) {
        int row = noticeMapper.delById(id);
        return row;
    }

    @Override
    public int deleteByBatch(Integer[] ids) {
        int rows = noticeMapper.delByBatch(ids);
        return rows;
    }
}
